<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>花语花坊</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/base.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/list.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/normalize.css"/>
    <script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/base.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/list.js"></script>
</head>
<body>
<header>
    <a href="#">
        <img src="${pageContext.request.contextPath}/static/images/header.jpg" height="80"  width="100%" alt="" >
    </a>
</header>
<div class="shortcut">
    <div class="w">
        <ul class="fl city">
            <li><i class="f10"></i><a href="#">天津</a></li>
        </ul>
        <ul class="fr nav">
            <c:if test="${!empty member.member_name}">
                <li>
                    <a href="${pageContext.request.contextPath}/member/getuserdetail" style="display: inline">你好，${member.member_name}</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/member/getloglogin" style="display: inline">退出登录</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </li>
            </c:if>


            <%--<li>
                <a href="${pageContext.request.contextPath}/member/getlogin" style="display: inline">登录</a></li>
                <li class="space">
                </li>--%>
            <c:if test="${empty member.member_name}">
                <li class="space"></li>
                <li>
                    <a href="${pageContext.request.contextPath}/getlogin" style="display: inline">你好，请登录</a>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </li>
                <li>
                    <a href="${pageContext.request.contextPath}/getregister" class="f10"  style="display: inline">免费注册</a>
                </li>
                <li class="space"></li>
                <li>
                    <a href="${pageContext.request.contextPath}/member/getpay"  style="display: inline">我的订单</a>
                </li>
                <li class="space"></li>
            </c:if>

            <li class="space"></li>

            <li>
                <a href="#">客户服务</a>
                <i></i>
                <div class="dropdown-layer">
                    <dl class="d">
                        <dd><a href="#">待处理订单</a></dd>
                        <dd><a href="#">返修退换货</a></dd>
                        <dd><a href="#">降价商品</a></dd>
                    </dl>
                    <dl class="d">
                        <dd><a href="#">消息</a></dd>
                        <dd><a href="#">我的问答</a></dd>
                        <dd><a href="#">我的关注</a></dd>
                    </dl>
                    <dl>
                        <dd><a href="#">我的优惠券</a></dd>
                    </dl>
                </div>
            </li>

            <li class="space"></li>
            <li>
                <div>
                    <a>花语花坊鲜花网：非常棒的鲜花网品牌</a>
                </div>


            </li>

        </ul>
    </div>
</div>
<div class="m">
    <div class="w middle">
        <div class="logo">
            <h1>  <!-- 提高权重 便利于搜索引擎优化 -->
                <a href="${pageContext.request.contextPath}/member/getindex" title="花语花坊">花语花坊</a>
            </h1>
        </div>
        <form class="form" action="${pageContext.request.contextPath}/product/findproductListSelect" method="post">
            <input id="text" name="SelectName" type="text" placeholder="商品搜索">
            <button type="submit"><i></i></button>
        </form>
        <div class="shopCar">
            <i></i><a href="${pageContext.request.contextPath}/member/getcart" class="f10">我的购物车</a><span>${countShopping}</span>
        </div>
        <div class="hotwords">
            <a href="#">红玫瑰</a>
            <a href="#">永生花</a>
            <a href="#">生日鲜花</a>
            <a href="#">礼品卡</a>
        </div>
        <div class="navitems">
            <ul>
                <li><a href="${pageContext.request.contextPath}/member/getindex">首页</a></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">鲜花</a></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">永生花</a></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">蛋糕</a></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">礼品</a></li>
                <li class="space "></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">巧克力</a></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">花语大全</a></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">企业团购</a></li>
                <li><a href="${pageContext.request.contextPath}/product/getproducandproductimageList">设计师甄选鲜花</a></li>
            </ul>
        </div>
    </div>
</div>
<%--<div class="sk_hd">
    <img src="${pageContext.request.contextPath}/static/images/header_textV2.png" alt="">
</div>--%>
<div class="w sk_container">
    <div class="sk_bd">
        <ul>
            <c:if test="${empty pageBean.lists}">
                没有该商品的信息
            </c:if>
            <%--<c:if test="${!empty productList}">--%>
                <c:forEach items="${pageBean.lists}" var="uproduct">
                    <li class="sk_goods">

                        <a href="${pageContext.request.contextPath}/detail/getdetail?product_id=${uproduct.product_id}">
                            <img src="${uproduct.productimages_src}" alt="" style="border-radius: 10px;margin-top: 10px"></a>
                        <h5 class="sk_goods_title" style="text-align: center">${uproduct.product_name}</h5>
                        <h5 class="sk_goods_title" style="text-align: center">${uproduct.product_context}</h5>
                        <p class="sk_goods_price" style="text-align: center"><em>¥${uproduct.product_price}</em> <del>￥${uproduct.product_s_price}</del></p>
                        <a href="javascript:void(0)" onclick="addCar(${uproduct.product_id})" class="sk_goods_buy">立即抢购</a>
                        <%--<a href="${pageContext.request.contextPath}/product/getdetail?id=${uproduct.product_id}" class="sk_goods_buy">立即抢购</a>--%>

                    </li>
                </c:forEach>
            <%--</c:if>--%>
            <%--<c:forEach items="${productList}" var="product" varStatus="i">
                <li class="sk_goods">

                        <a href="${pageContext.request.contextPath}/detail/getdetail.action?product_id=${product.product_id}">
                            <img src="${product.productimage.productimage_src}" alt="" style="border-radius: 10px;margin-top: 10px"></a>
                        <h5 class="sk_goods_title" style="text-align: center">${product.product_name}</h5>
                        <h5 class="sk_goods_title" style="text-align: center">${product.product_context}</h5>
                        &lt;%&ndash;<h5 class="sk_goods_title">${product.product_title}</h5>&ndash;%&gt;
                        <p class="sk_goods_price" style="text-align: center"><em>¥${product.product_price}</em> <del>￥${product.product_s_price}</del></p>
                        &lt;%&ndash;<div class="sk_goods_progress">
                            已售<i>87%</i>
                            <div class="bar">
                                <div class="bar_in"></div>
                            </div>
                            剩余<em>29</em>件
                        </div>&ndash;%&gt;
                        <a href="${pageContext.request.contextPath}/product/getdetail?id=${product.product_id}" class="sk_goods_buy">立即抢购</a>

                </li>
            </c:forEach>--%>

        </ul>
    </div>
    <div class="sk_page">
        <span>第${pageBean.currPage }/ ${pageBean.totalPage}页</span>&nbsp;&nbsp;
        <span>总记录数：${pageBean.totalCount }&nbsp;&nbsp;每页显示:${pageBean.pageSize}</span>&nbsp;&nbsp;
    </div>
    <div class="sk_page">
            <span class="page_num">
                <c:if test="${pageBean.currPage != 1}">
                    <a href="${pageContext.request.contextPath }/product/getproducandproductimageList?currentPage=${pageBean.currPage-1}"  class="pn-prev">上一页</a>&nbsp;&nbsp;
                </c:if>
                <a href="${pageContext.request.contextPath }/product/getproducandproductimageList?currentPage=1" class="current">1</a>&nbsp;&nbsp;
                <c:forEach begin="2" end="${pageBean.totalPage}" var="i">
                    <a href="${pageContext.request.contextPath}/product/getproducandproductimageList?currentPage=${i}">${i}</a>
                </c:forEach>
                <a href="#" class="dotted">...</a>
                <c:if test="${pageBean.currPage != pageBean.totalPage}">
                    <a href="${pageContext.request.contextPath }/product/getproducandproductimageList?currentPage=${pageBean.currPage+1}" class="pn-next">下一页&gt;&gt;</a>&nbsp;&nbsp;
                    <a href="${pageContext.request.contextPath }/product/getproducandproductimageList?currentPage=${pageBean.totalPage}">尾页</a>&nbsp;&nbsp;
                </c:if>
            </span>
        <span class="page_skip">
                共${pageBean.totalPage}页
        </span>
    </div>

</div>
<footer>
    <div class="service">
        <!-- 服务模块 -->
        <div class="w">
            <ul>
                <li>
                    <h5></h5>
                    <p>品类齐全，轻松购物</p>
                </li>
                <li>
                    <h5></h5>
                    <p>品类齐全，轻松购物</p>
                </li>
                <li>
                    <h5></h5>
                    <p>品类齐全，轻松购物</p>
                </li>
                <li>
                    <h5></h5>
                    <p>品类齐全，轻松购物</p>
                </li>
            </ul>
        </div>
    </div>
    <!-- 帮助模块 -->
    <div class="w help">
        <div class="fl">
            <dl>
                <dt>购物指南</dt>
                <dd><a href="#">购物流程</a></dd>
                <dd><a href="#">会员介绍</a></dd>
                <dd><a href="#">生活旅行</a></dd>
                <dd><a href="#">常见问题</a></dd>
                <dd><a href="#">大家电</a></dd>
                <dd><a href="#">联系客服</a></dd>
            </dl>
            <dl>
                <dt>配送方式</dt>
                <dd><a href="#">上门自提</a></dd>
                <dd><a href="#">211限时达</a></dd>
                <dd><a href="#">配送服务查询</a></dd>
                <dd><a href="#">配送费收取标准</a></dd>
                <dd><a href="#">海外配送</a></dd>
            </dl>
            <dl>
                <dt>支付方式</dt>
                <dd><a href="#">货到付款</a></dd>
                <dd><a href="#">在线支付</a></dd>
                <dd><a href="#">分期付款</a></dd>
                <dd><a href="#">邮局汇款</a></dd>
                <dd><a href="#">公司转账</a></dd>
            </dl>
            <dl>
                <dt>售后服务</dt>
                <dd><a href="#">售后政策</a></dd>
                <dd><a href="#">价格保护</a></dd>
                <dd><a href="#">退款说明</a></dd>
                <dd><a href="#">返修/退换货</a></dd>
                <dd><a href="#">取消订单</a></dd>
            </dl>
            <dl>
                <dt>特色服务</dt>
                <dd><a href="#">夺宝岛</a></dd>
                <dd><a href="#">DIY装机</a></dd>
                <dd><a href="#">延保服务</a></dd>
                <dd><a href="#">京东E卡</a></dd>
                <dd><a href="#">京东通信</a></dd>
                <dd><a href="#">京鱼座智能</a></dd>
            </dl>
        </div>
        <div class="fr coverage">
            <h5>京东自营覆盖区县</h5>
            <p>京东已向全国2661个区县提供自营配送服务，支持货到付款、POS机刷卡和售后上门服务。</p>
            <a href="#">查看详情 > </a>
        </div>
    </div>
    <div class="w copyright">
        <p>
            <a href="#">关于我们</a>
            <span> | </span>
            <a href="#">联系我们</a>
            <span> | </span>
            <a href="#">联系客服</a>
            <span> | </span>
            <a href="#">合作招商</a>
            <span> | </span>
            <a href="#">商家帮助</a>
            <span> | </span>
            <a href="#">营销中心</a>
            <span> | </span>
            <a href="#">手机京东</a>
            <span> | </span>
            <a href="#">友情链接</a>
            <span> | </span>
            <a href="#">销售联盟</a>
            <span> | </span>
            <a href="#">京东社区</a>
            <span> | </span>
            <a href="#">风险监测</a>
            <span> | </span>
            <a href="#">隐私政策</a>
            <span> | </span>
            <a href="#">京东公益</a>
            <span> | </span>
            <a href="#">English Site</a>
            <span> | </span>
            <a href="#">Media & IR</a>
        </p>
        <div>
            <p>京公网安备 11000002000088号<span>|</span>京ICP证070359号<span>|</span>互联网药品信息服务资格证编号(京)-经营性-2014-0008<span>|</span>新出发京零 字第大120007号</p>
            <p>互联网出版许可证编号新出网证(京)字150号<span>|</span>出版物经营许可证<span>|</span>网络文化经营许可证京网文[2014]2148-348号<span>|</span>违法和不良信息举报电话：4006561155</p>
            <p>Copyright © 2004 - 2019  京东JD.com 版权所有<span>|</span>消费者维权热线：4006067733经营证照|(京)网械平台备字(2018)第00003号<span>|</span>营业执照</p>
            <p>Global Site<span>|</span>Сайт России<span>|</span>Situs Indonesia<span>|</span>Sitio de España<span>|</span>เว็บไซต์ประเทศไทย</p>
            <p>京东旗下网站：京东钱包<span>|</span>京东云</p>
        </div>
        <p class="foot-icon">
            <a href="#"></a>
            <a href="#"></a>
            <a href="#"></a>
            <a href="#"></a>
            <a href="#"></a>
            <a href="#"></a>
        </p>
    </div>
</footer>
</body>
<script>
    function addCar(id) {

        var pathName=document.location.pathname;
        console.log("pathName="+pathName);
        var index=pathName.substr(1).indexOf("/");
        var result=pathName.substr(0,index+1);
        console.log(result);
        var a=1;
        /*int member_id,int product_id,int shopping_product_amount*/
        $.ajax({
            url:result+"/cart/addcart",
            type:"get",
            data:{product_id:id,shopping_product_amount:a},
            dataType:"json",
            success:function (data) {
                if (data.success){
                    alert("添加购物车成功");
                }else {
                    alert("您好，请登录您的账号！");
                }
            }
        })
    }
</script>